<!DOCTYPE HTML PUBLIC "-//ORA//DTD CD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE>[Chapter 12] The java.lang Package</TITLE>
<META NAME="author" CONTENT="Mark Grand and Jonathan Knudsen">
<META NAME="date" CONTENT="Fri Aug  8 16:58:28 1997">
<META NAME="form" CONTENT="html">
<META NAME="metadata" CONTENT="dublincore.0.1">
<META NAME="objecttype" CONTENT="book part">
<META NAME="otheragent" CONTENT="gmat dbtohtml">
<META NAME="publisher" CONTENT="O'Reilly &amp; Associates, Inc.">
<META NAME="source" CONTENT="SGML">
<META NAME="subject" CONTENT="Java">
<META NAME="title" CONTENT="Java Fundamental Classes Reference">
<META HTTP-EQUIV="Content-Script-Type" CONTENT="text/javascript">
</HEAD>
<body vlink="#551a8b" alink="#ff0000" text="#000000" bgcolor="#FFFFFF" link="#0000ee">
<script language='JavaScript'>
<!--
if (location.replace) {
 location.replace ('ch12_js.htm');
}
// -->
</script>

<DIV CLASS=htmlnav>
<H1><a href='index.htm'><IMG SRC="gifs/smbanner.gif"
     ALT="Java Fundamental Classes Reference" border=0></a></H1>
<table width=515 border=0 cellpadding=0 cellspacing=0>
<tr>
<td width=172 align=left valign=top><A HREF="ch11_69.htm"><IMG SRC="gifs/txtpreva.gif" ALT="Previous" border=0></A></td>
<td width=171 align=center valign=top><B><FONT FACE="ARIEL,HELVETICA,HELV,SANSERIF" SIZE="-1">Chapter 12</FONT></B></TD>
<td width=172 align=right valign=top><A HREF="ch12_02.htm"><IMG SRC="gifs/txtnexta.gif" ALT="Next" border=0></A></td>
</tr>
</table>

&nbsp;
<hr align=left width=515>
</DIV>
<H1 CLASS=chapter><A CLASS="TITLE" NAME="JFC-CH-12">12. The java.lang Package</A></H1>

<DIV CLASS=htmltoc>

<p>
<b>Contents:</b><br>
<a href='ch12_02.htm'>ArithmeticException</a><br>
<a href='ch12_03.htm'>ArrayIndexOutOfBoundsException</a><br>
<a href='ch12_04.htm'>ArrayStoreException</a><br>
<a href='ch12_05.htm'>Boolean</a><br>
<a href='ch12_06.htm'>Byte</a><br>
<a href='ch12_07.htm'>Character</a><br>
<a href='ch12_08.htm'>Class</a><br>
<a href='ch12_09.htm'>ClassCastException</a><br>
<a href='ch12_10.htm'>ClassCircularityError</a><br>
<a href='ch12_11.htm'>ClassFormatError</a><br>
<a href='ch12_12.htm'>ClassLoader</a><br>
<a href='ch12_13.htm'>ClassNotFoundException</a><br>
<a href='ch12_14.htm'>Cloneable</a><br>
<a href='ch12_15.htm'>CloneNotSupportedException</a><br>
<a href='ch12_16.htm'>Compiler</a><br>
<a href='ch12_17.htm'>Double</a><br>
<a href='ch12_18.htm'>Error</a><br>
<a href='ch12_19.htm'>Exception</a><br>
<a href='ch12_20.htm'>ExceptionInInitializerError</a><br>
<a href='ch12_21.htm'>Float</a><br>
<a href='ch12_22.htm'>IllegalAccessError</a><br>
<a href='ch12_23.htm'>IllegalAccessException</a><br>
<a href='ch12_24.htm'>IllegalArgumentException</a><br>
<a href='ch12_25.htm'>IllegalMonitorStateException</a><br>
<a href='ch12_26.htm'>IllegalStateException</a><br>
<a href='ch12_27.htm'>IllegalThreadStateException</a><br>
<a href='ch12_28.htm'>IncompatibleClassChangeError</a><br>
<a href='ch12_29.htm'>IndexOutOfBoundsException</a><br>
<a href='ch12_30.htm'>Integer</a><br>
<a href='ch12_31.htm'>InstantiationError</a><br>
<a href='ch12_32.htm'>InstantiationException</a><br>
<a href='ch12_33.htm'>InternalError</a><br>
<a href='ch12_34.htm'>InterruptedException</a><br>
<a href='ch12_35.htm'>LinkageError</a><br>
<a href='ch12_36.htm'>Long</a><br>
<a href='ch12_37.htm'>Math</a><br>
<a href='ch12_38.htm'>NegativeArraySizeException</a><br>
<a href='ch12_39.htm'>NoClassDefFoundError</a><br>
<a href='ch12_40.htm'>NoSuchFieldError</a><br>
<a href='ch12_41.htm'>NoSuchFieldException</a><br>
<a href='ch12_42.htm'>NoSuchMethodError</a><br>
<a href='ch12_43.htm'>NoSuchMethodException</a><br>
<a href='ch12_44.htm'>NullPointerException</a><br>
<a href='ch12_45.htm'>Number</a><br>
<a href='ch12_46.htm'>NumberFormatException</a><br>
<a href='ch12_47.htm'>Object</a><br>
<a href='ch12_48.htm'>OutOfMemoryError</a><br>
<a href='ch12_49.htm'>Process</a><br>
<a href='ch12_50.htm'>Runnable</a><br>
<a href='ch12_51.htm'>Runtime</a><br>
<a href='ch12_52.htm'>RuntimeException</a><br>
<a href='ch12_53.htm'>SecurityException</a><br>
<a href='ch12_54.htm'>SecurityManager</a><br>
<a href='ch12_55.htm'>Short</a><br>
<a href='ch12_56.htm'>StackOverflowError</a><br>
<a href='ch12_57.htm'>String</a><br>
<a href='ch12_58.htm'>StringBuffer</a><br>
<a href='ch12_59.htm'>StringIndexOutOfBoundsException</a><br>
<a href='ch12_60.htm'>System</a><br>
<a href='ch12_61.htm'>Thread</a><br>
<a href='ch12_62.htm'>ThreadDeath</a><br>
<a href='ch12_63.htm'>ThreadGroup</a><br>
<a href='ch12_64.htm'>Throwable</a><br>
<a href='ch12_65.htm'>UnknownError</a><br>
<a href='ch12_66.htm'>UnsatisfiedLinkError</a><br>
<a href='ch12_67.htm'>VerifyError</a><br>
<a href='ch12_68.htm'>VirtualMachineError</a><br>
<a href='ch12_69.htm'>Void</a><br>
<p>
<p>
</DIV>

<P CLASS=para>
The package <tt CLASS=literal>java.lang</tt> contains classes and interfaces that
are essential to the Java language. These include:

<P>
<UL CLASS=itemizedlist>
<li CLASS=listitem><tt CLASS=literal>Object</tt>, the ultimate superclass of
all classes in Java.

<P>
<li CLASS=listitem><tt CLASS=literal>Thread</tt>, the class that controls
each thread in a multithreaded program.

<P>
<li CLASS=listitem><tt CLASS=literal>Throwable</tt>, the superclass of all error and exception
classes in Java.

<P>
<li CLASS=listitem>Classes that encapsulate the primitive data types
in Java.

<P>
<li CLASS=listitem>Classes for accessing system resources and other
low-level entities.

<P>
<li CLASS=listitem><tt CLASS=literal>Math</tt>, a class that provides standard mathematical
methods.

<P>
<li CLASS=listitem><tt CLASS=literal>String</tt>, the class that represents strings.

<P>
</UL>
<P CLASS=para>
Because the classes in the <tt CLASS=literal>java.lang</tt>
package are so essential, the <tt CLASS=literal>java.lang</tt>
package is implicitly imported by every Java source file. In other
words, you can refer to all of the classes and interfaces in
<tt CLASS=literal>java.lang</tt> using their simple names.

<P CLASS=para>
<A HREF="ch12_01.htm#JFC-CH-12-FIG-1">Figure 12.1</A> shows the class hierarchy for
the <tt CLASS=literal>java.lang</tt> package.

<P CLASS=para>
The possible exceptions in a Java program are organized in a hierarchy
of exception classes.  The <tt CLASS=literal>Throwable</tt> class is at
the root of the exception hierarchy. <tt CLASS=literal>Throwable</tt> has
two immediate subclasses: <tt CLASS=literal>Exception</tt> and 
<tt CLASS=literal>Error</tt>.  
<A HREF="ch12_01.htm#JFC-CH-12-FIG-2">Figure 12.2</A> shows the standard exception
classes defined in the <tt CLASS=literal>java.lang</tt> package, while
<A HREF="ch12_01.htm#JFC-CH-12-FIG-3">Figure 12.3</A> shows the standard error
classes defined in <tt CLASS=literal>java.lang</tt>.

<DIV CLASS=figure>
<h4 CLASS=figure><A CLASS="TITLE" NAME="JFC-CH-12-FIG-1">Figure 12.1: The java.lang package</A></h4>


<p>
<img align=middle src="./figs/jfc_1201.gif" alt="[Graphic: Figure 12-1]" width=502 height=588 border=0>

</DIV>

<DIV CLASS=figure>
<h4 CLASS=figure><A CLASS="TITLE" NAME="JFC-CH-12-FIG-2">Figure 12.2: The exception classes in the java.lang package</A></h4>


<p>
<img align=middle src="./figs/jfc_1202.gif" alt="[Graphic: Figure 12-2]" width=502 height=323 border=0>

</DIV>

<DIV CLASS=figure>
<h4 CLASS=figure><A CLASS="TITLE" NAME="JFC-CH-12-FIG-3">Figure 12.3: The error classes in the java.lang package</A></h4>


<p>
<img align=middle src="./figs/jfc_1203.gif" alt="[Graphic: Figure 12-3]" width=502 height=413 border=0>

</DIV>

<DIV CLASS=refnamediv>
<H1>AbstractMethodError</H1>

<H2>Name</H2>

AbstractMethodError

</DIV>

<DIV CLASS=refsect1>
<h2 CLASS=refsect1><A CLASS="TITLE" NAME="ch12-REFSECT1-AUTOID.1">Synopsis</A></h2>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Class Name:<br>
<DD>

<P CLASS=para>
<tt CLASS=literal>java.lang.AbstractMethodError</tt>

<p>
<DT CLASS=varlistentry>Superclass:<br>
<DD>

<P CLASS=para>
<tt CLASS=literal>java.lang.IncompatibleClassChangeError</tt> 

<p>
<DT CLASS=varlistentry>Immediate Subclasses:<br>
<DD>

<P CLASS=para>
None 

<p>
<DT CLASS=varlistentry>Interfaces Implemented:<br>
<DD>

<P CLASS=para>
None 

<p>
<DT CLASS=varlistentry>Availability:<br>
<DD>

<P CLASS=para>
JDK 1.0 or later</DL>
</DIV>

<DIV CLASS=refsect1>
<h2 CLASS=refsect1><A CLASS="TITLE" NAME="ch12-REFSECT1-AUTOID.2">Description</A></h2>

<P CLASS=para>
An <tt CLASS=literal>AbstractMethodError</tt> is thrown 
when there is an attempt to invoke an <tt CLASS=literal>abstract </tt>method. 

</DIV>

<DIV CLASS=refsect1>
<h2 CLASS=refsect1><A CLASS="TITLE" NAME="ch12-REFSECT1-AUTOID.3">Class Summary</A></h2>

<DIV CLASS=screen>
<P>
<PRE>
public class java.lang.AbstractMethodError
             extends java.lang.IncompatibleClassChangeError {
  // Constructors
  public AbstractMethodError();
  public AbstractMethodError(String s);
}
</PRE>
</DIV>

</DIV>

<DIV CLASS=refsect1>
<h2 CLASS=refsect1><A CLASS="TITLE" NAME="ch12-REFSECT1-AUTOID.4">Constructors</A></h2>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch12-REFSECT2-AUTOID.1">AbstractMethodError</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch12-REFSECT3-AUTOID.1">public AbstractMethodError()</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
This constructor creates an <tt CLASS=literal>AbstractMethodError</tt> 
with no associated detail message. </DL>
</DIV>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch12-REFSECT3-AUTOID.2">public AbstractMethodError(String s)</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><tt CLASS=literal>s</tt><br>
<DD>

<P CLASS=para>
The detail message. </DL>
<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
This constructor creates an <tt CLASS=literal>AbstractMethodError</tt> 
with the specified detail message. </DL>
</DIV>

</DIV>

</DIV>

<DIV CLASS=refsect1>
<h2 CLASS=refsect1><A CLASS="TITLE" NAME="ch12-REFSECT1-AUTOID.5">Inherited Methods</A></h2>

<DIV CLASS=informaltable>
<P>
<TABLE CLASS=INFORMALTABLE>
<TR CLASS=row>
<TH ALIGN="LEFT">

<P CLASS=para>
Method</TH>
<TH ALIGN="LEFT">

<P CLASS=para>
Inherited From</TH>
<TH ALIGN="LEFT">

<P CLASS=para>
Method</TH>
<TH ALIGN="LEFT">

<P CLASS=para>
Inherited From</TH>
</TR>
<TR CLASS=row>
<TD ALIGN="LEFT">

<P CLASS=para>
<tt CLASS=literal>clone() </tt></TD>
<TD ALIGN="LEFT">

<P CLASS=para>
<tt CLASS=literal>Object</tt></TD>
<TD ALIGN="LEFT">

<P CLASS=para>
<tt CLASS=literal>equals(Object)</tt></TD>
<TD ALIGN="LEFT">

<P CLASS=para>
<tt CLASS=literal>Object</tt></TD>
</TR>
<TR CLASS=row>
<TD ALIGN="LEFT">

<P CLASS=para>
<tt CLASS=literal>fillInStackTrace()</tt></TD>
<TD ALIGN="LEFT">

<P CLASS=para>
<tt CLASS=literal>Throwable</tt></TD>
<TD ALIGN="LEFT">

<P CLASS=para>
<tt CLASS=literal>finalize()</tt></TD>
<TD ALIGN="LEFT">

<P CLASS=para>
<tt CLASS=literal>Object</tt></TD>
</TR>
<TR CLASS=row>
<TD ALIGN="LEFT">

<P CLASS=para>
<tt CLASS=literal>getClass()</tt></TD>
<TD ALIGN="LEFT">

<P CLASS=para>
<tt CLASS=literal>Object</tt></TD>
<TD ALIGN="LEFT">

<P CLASS=para>
<tt CLASS=literal>getLocalizedMessage()</tt></TD>
<TD ALIGN="LEFT">

<P CLASS=para>
<tt CLASS=literal>Throwable</tt></TD>
</TR>
<TR CLASS=row>
<TD ALIGN="LEFT">

<P CLASS=para>
<tt CLASS=literal>getMessage()</tt></TD>
<TD ALIGN="LEFT">

<P CLASS=para>
<tt CLASS=literal>Throwable</tt></TD>
<TD ALIGN="LEFT">

<P CLASS=para>
<tt CLASS=literal>hashCode()</tt></TD>
<TD ALIGN="LEFT">

<P CLASS=para>
<tt CLASS=literal>Object</tt></TD>
</TR>
<TR CLASS=row>
<TD ALIGN="LEFT">

<P CLASS=para>
<tt CLASS=literal>notify()</tt></TD>
<TD ALIGN="LEFT">

<P CLASS=para>
<tt CLASS=literal>Object</tt></TD>
<TD ALIGN="LEFT">

<P CLASS=para>
<tt CLASS=literal>notifyAll()</tt></TD>
<TD ALIGN="LEFT">

<P CLASS=para>
<tt CLASS=literal>Object</tt></TD>
</TR>
<TR CLASS=row>
<TD ALIGN="LEFT">

<P CLASS=para>
<tt CLASS=literal>printStackTrace()</tt></TD>
<TD ALIGN="LEFT">

<P CLASS=para>
<tt CLASS=literal>Throwable</tt></TD>
<TD ALIGN="LEFT">

<P CLASS=para>
<tt CLASS=literal>printStackTrace(PrintStream)</tt></TD>
<TD ALIGN="LEFT">

<P CLASS=para>
<tt CLASS=literal>Throwable</tt></TD>
</TR>
<TR CLASS=row>
<TD ALIGN="LEFT">

<P CLASS=para>
<tt CLASS=literal>printStackTrace(PrintWriter)</tt></TD>
<TD ALIGN="LEFT">

<P CLASS=para>
<tt CLASS=literal>Throwable</tt></TD>
<TD ALIGN="LEFT">

<P CLASS=para>
<tt CLASS=literal>toString()</tt></TD>
<TD ALIGN="LEFT">

<P CLASS=para>
<tt CLASS=literal>Object</tt></TD>
</TR>
<TR CLASS=row>
<TD ALIGN="LEFT">

<P CLASS=para>
<tt CLASS=literal>wait()</tt></TD>
<TD ALIGN="LEFT">

<P CLASS=para>
<tt CLASS=literal>Object</tt></TD>
<TD ALIGN="LEFT">

<P CLASS=para>
<tt CLASS=literal>wait(long)</tt></TD>
<TD ALIGN="LEFT">

<P CLASS=para>
<tt CLASS=literal>Object</tt></TD>
</TR>
<TR CLASS=row>
<TD ALIGN="LEFT">

<P CLASS=para>
<tt CLASS=literal>wait(long, int)</tt></TD>
<TD ALIGN="LEFT">

<P CLASS=para>
<tt CLASS=literal>Object</tt></TD>
<TD ALIGN="LEFT">&nbsp;</TD>
<TD ALIGN="LEFT">&nbsp;</TD>
</TR>
</TABLE>
<P>
</DIV>

</DIV>

<DIV CLASS=refsect1>
<h2 CLASS=refsect1><A CLASS="TITLE" NAME="ch12-REFSECT1-AUTOID.6">See Also</A></h2>

<P CLASS=para>
<tt CLASS=literal>Error</tt>, 
<tt CLASS=literal>IncompatibleClassChangeError</tt>, 
<tt CLASS=literal>Throwable</tt> 
</DIV>


<DIV CLASS=htmlnav>

<P>
<HR align=left width=515>
<table width=515 border=0 cellpadding=0 cellspacing=0>
<tr>
<td width=172 align=left valign=top><A HREF="ch11_69.htm"><IMG SRC="gifs/txtpreva.gif" ALT="Previous" border=0></A></td>
<td width=171 align=center valign=top><a href="index.htm"><img src='gifs/txthome.gif' border=0 alt='Home'></a></td>
<td width=172 align=right valign=top><A HREF="ch12_02.htm"><IMG SRC="gifs/txtnexta.gif" ALT="Next" border=0></A></td>
</tr>
<tr>
<td width=172 align=left valign=top>Writer</td>
<td width=171 align=center valign=top><a href="index/idx_0.htm"><img src='gifs/index.gif' alt='Book Index' border=0></a></td>
<td width=172 align=right valign=top>ArithmeticException</td>
</tr>
</table>
<hr align=left width=515>

<IMG SRC="gifs/smnavbar.gif" USEMAP="#map" BORDER=0> 
<MAP NAME="map"> 
<AREA SHAPE=RECT COORDS="0,0,108,15" HREF="../javanut/index.htm"
alt="Java in a Nutshell"> 
<AREA SHAPE=RECT COORDS="109,0,200,15" HREF="../langref/index.htm" 
alt="Java Language Reference"> 
<AREA SHAPE=RECT COORDS="203,0,290,15" HREF="../awt/index.htm" 
alt="Java AWT"> 
<AREA SHAPE=RECT COORDS="291,0,419,15" HREF="../fclass/index.htm" 
alt="Java Fundamental Classes"> 
<AREA SHAPE=RECT COORDS="421,0,514,15" HREF="../exp/index.htm" 
alt="Exploring Java"> 
</MAP>
</DIV>

</BODY>
</HTML>
